package com.app.main.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.app.main.domain.Main;
import com.app.main.service.MainService;

@Controller
public class MainController {
	static Logger logger = LoggerFactory.getLogger(MainController.class);
	
	@Autowired
	MainService mainService;
	
	@RequestMapping("main/main_complete.do")
	public ModelAndView main(Main main, BindingResult result) {
		ModelAndView mav = new ModelAndView();
		mav.setViewName("main/main_complete");
		
		logger.info("{}", main.getName());
		
//		new MainValidator().validate(main, result);
//		if(result.hasErrors()) {
//			System.out.println(result.getErrorCount());
//		}
//		mav.addObject("main", mainService.main());
		
		return mav;
	}
	
}
